﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.ComponentModel;

namespace BlueRoseGames.Controls.Text
{
    public class Transform : PropertyChangedDependencyObject
    {
        #region DependencyProperties

        public static readonly DependencyProperty DisabledProperty = Register("Disabled", typeof(bool), typeof(Transform), false);
        public bool Disabled
        {
            get { return (bool)GetValue(DisabledProperty); }
            set { SetValue(DisabledProperty, value); }
        }

        #endregion

        public virtual Point TransformPoint(Point p)
        {
            return p;
        }

        public virtual bool Changed
        {
            set;
            get;
        }

        protected new static DependencyProperty Register(string name, Type propertyType, Type ownerType, object defaultValue)
        {
            return PropertyChangedDependencyObject.Register(name, propertyType, ownerType, defaultValue, Transform.OnPropertyChanged);
        }

        protected new static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var t = d as Transform;
            if (t != null)
                t.Changed = true;

            PropertyChangedDependencyObject.OnPropertyChanged(d, e);
        }
    }
}
